package com.yifeng.repo.apm.endpoint.logging.log4j2;

import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.core.config.Configuration;
import org.apache.logging.log4j.core.config.ConfigurationFactory;
import org.apache.logging.log4j.core.config.ConfigurationSource;
import org.apache.logging.log4j.core.config.Order;
import org.apache.logging.log4j.core.config.plugins.Plugin;
import org.apache.logging.log4j.core.config.xml.XmlConfigurationFactory;

/**
 * Created by daibing on 2020/9/3.
 * 不需要设置启动参数，log4j2支持读取log4j2.component.properties
 */
@Plugin(name = "TraceXmlConfigurationFactory", category = ConfigurationFactory.CATEGORY)
@Order(5)
public class TraceXmlConfigurationFactory extends XmlConfigurationFactory {

    @Override
    public Configuration getConfiguration(final LoggerContext loggerContext, final ConfigurationSource source) {
        return new TraceXmlConfiguration(loggerContext, source);
    }

}
